package com.bestv.database.dao;

import com.bestv.database.vo.ItemRelation;
import com.bestv.database.vo.Series;
import com.bestv.lucene.ProgramSearcher;

import java.util.List;

/**
 * Created by Henry on 14-5-21.
 */
public class SeriesDao extends BaseDao<Series> {
    public Series findByName(String name) {
        ProgramSearcher searcher = new ProgramSearcher();
        List<Object> result = searcher.search(name, 1);
        searcher.close();
        if (result.size() < 1) return null;
        ItemRelation relation = (ItemRelation) result.get(0);
        return findById(relation.getRightId());
    }
}
